<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>平均值</title>
</head>
<body>
        <script>
        var arr=[88,66,55,23,112];
            i = 0;
            s = 0;

            while (i<arr.length){
                s = s + arr[i];   //s = s+ 数组里的和
                i++;

            }
           z =  s / arr.length;    // s取得的总和， 除以这个数组的长度，最后求得平均数68.8
        console.log(z);


        </script>
</body>
</html>